home *** CD-ROM | disk | FTP | other *** search
/ EOS Science Plan & Executive Summary / EOS Science Plan and Executive Summary.iso / pc / Acrobat Reader Installers / linux_tar_files / COMMON.TAR / Browsers / netscape
Encoding:
Text File  |  2002-03-20  |  5.0 KB  |  214 lines

  1. #!/bin/sh
  2. #
  3. # Copyright (c) 1996-2002, Adobe Systems Incorporated
  4. # All Rights Reserved
  5. #
  6. # This is an example script to show you how to launch Netscape (TM) with
  7. # Acrobat 5.0.5 integration.  If the script is run unmodified, it will
  8. # query the user for: 1). the installation directory for Acrobat 5.0.5 and
  9. # 2). the installation directory for Netscape.  You may modify the
  10. # script where indicated to identify the proper directories.
  11. #
  12.  
  13. #
  14. # Initialization
  15. #
  16. osname=`uname -s`
  17. osrelease=`uname -r`
  18. args="$@"
  19.  
  20. echoawk ()
  21. {
  22.   echo $* | awk '{ printf "%s", $0 }'
  23. }
  24.  
  25. echon ()
  26. {
  27.   echo -n "$*"
  28. }
  29.  
  30. echoc ()
  31. {
  32.   echo "${*}\c"
  33. }
  34.  
  35. if [ `echo "x\c"` = "x" ] ; then
  36.   echonl=echoc
  37. else
  38.   echonl=echon
  39. fi
  40.  
  41. ndefault="/usr/local/Netscape"
  42. adefault="/usr/local/Acrobat5"
  43. case "$osname" in
  44.   SunOS)
  45.     case "$osrelease" in
  46.       4.1.[34]*)
  47.         adefault="/usr/Acrobat5"
  48.         ;;
  49.       5.*)
  50.         adefault="/opt/Acrobat5"
  51.         ;;
  52.     esac
  53.     ;;
  54.   HP-UX)
  55.     case "$osrelease" in
  56.       *.09.*)
  57.         adefault="/usr/local/Acrobat5"
  58.         ;;
  59.       *.10.*)
  60.         adefault="/opt/Acrobat5"
  61.         ;;
  62.       esac
  63.     ;;
  64.   Linux)
  65.     adefault="/usr/local/Acrobat5"
  66.     ;;
  67. esac
  68.  
  69. #
  70. # The Shell variable "adir" identifies the Acrobat 5.0.5 installation
  71. # directory.  If the value of "$adir" is zero length, the user will
  72. # be prompted to enter the installation directory for Acrobat 5.0.5
  73. # The correct directory for Acrobat may be added after the equals
  74. # sign on the line below.
  75. #
  76. adir=
  77.  
  78. #
  79. # The Shell variable "ndir" identifies the Netscape installation
  80. # directory.  If the value of "$ndir" is zero length, the user will
  81. # be prompted to enter the installation directory for Netscape.
  82. # The correct directory for Netscape may be added after the equals
  83. # sign on the line below.
  84. # NOTE: If the "netscape" executable is in the $ndir path, this
  85. # script will succeed also. (e.g. /usr/bin/netscape).
  86. #
  87. ndir=
  88.  
  89. #
  90. # The following lines are fairly generic and should not require
  91. # any modification. They just test to see if the Acrobat installation
  92. # directory is somewhat valid.
  93. #
  94. while [ -z "$adir" ] ; do
  95.   $echonl "Enter the Acrobat 5.0.5 install directory [$adefault] "
  96.   read answer
  97.   if [ -z "$answer" ] ; then
  98.     adir="$adefault"
  99.   else
  100.     adir="$answer"
  101.   fi
  102. done
  103. if [ ! -d "$adir" ] || [ ! -d "$adir"/Browsers ] ; then
  104.   echo " "
  105.   echo "The installation directory:"
  106.   echo " "
  107.   echo "$adir"
  108.   echo " "
  109.   echo "is not a valid Acrobat 5.0.5 installation.  You will not"
  110.   echo "be able to view embedded PDF's and view PDF's in Netscape."
  111.   echo "Please consult a system administrator at your site to get the"
  112.   echo "pathname to the Acrobat 5.0.5 installation."
  113.   echo " "
  114. fi
  115.  
  116. while [ -z "$ndir" ] ; do
  117.   $echonl "Enter the directory containing Netscape [$ndefault] "
  118.   read answer
  119.   if [ -z "$answer" ] ; then
  120.     ndir="$ndefault"
  121.   else
  122.     ndir="$answer"
  123.   fi
  124. done
  125.  
  126. case "$osname" in
  127.   SunOS)
  128.     osplatform=`uname -p`
  129.     case "$osplatform" in
  130.     sparc)
  131.             case "$osrelease" in
  132.               4.1.[34]*)
  133.                  pconfig=sparcsun
  134.                  XNLSPATH="$ndir"/nls
  135.                  export XNLSPATH
  136.              ;;
  137.               5.3*) pconfig=sparcsolaris 
  138.         ;;
  139.               5.[4567]*) pconfig=sparcsolaris 
  140.         ;;
  141.              esac
  142.              ;;
  143.    esac 
  144.    ;;
  145.   HP-UX) pconfig=hppahpux 
  146.     ;;
  147.   Linux) pconfig=intellinux
  148.     ;;
  149.   AIX) pconfig=rs6000aix
  150.     ;;
  151. esac
  152.  
  153.  
  154. #
  155. # Point Netscape to its Keysym Database.  This is recommended practice.
  156. # but can cause very bad results if pointed at the wrong directory.
  157. # XKEYSYMDB="$ndir"/XKeysymDB
  158. # export XKEYSYMDB
  159. #echo "XKEYSYMDB is $XKEYSYMDB"
  160.  
  161. #
  162. # This points Netscape to the Acrobat viewer plug-in so that PDF's
  163. # may be viewed inside of the Netscape window.
  164. #
  165. NPX_PLUGIN_PATH="$adir"/Browsers/$pconfig
  166. export NPX_PLUGIN_PATH
  167. #echo "NPX_PLUGIN_PATH is $NPX_PLUGIN_PATH"
  168.  
  169. #
  170. # We must make sure that the Acrobat Reader and/or Exchange are on
  171. # the execution search path.  The Acrobat plug-in for Netscape tries
  172. # to execute the correct version of Acrobat.
  173. #
  174. PATH="$adir"/bin:$PATH
  175. export PATH
  176.  
  177. #
  178. # Netscape needs to have its current resources so let's set them here.
  179. #
  180. XENVIRONMENT="$ndir"/Netscape.ad
  181. export XENVIRONMENT
  182.  
  183. #
  184. # Now to launch Netscape.  We take a look to see if the directory exists
  185. # and if the file called "netscape" inside of the directory is executable.
  186. # If neither condition is true, then we blurt out a short error message.
  187. #
  188.  
  189. if [ -d "$ndir" ] ; then
  190.   if [ -x "$ndir"/netscape ] ; then
  191.     exec "$ndir"/netscape ${netscape_args} $args
  192.   else
  193.     if [ -x "$ndir"/netscape-communicator ] ; then
  194.       exec "$ndir"/netscape-communicator ${netscape_args} $args
  195.     else
  196.       echo " "
  197.       echo "$ndir/netscape or netscape-communicator either does not exist"
  198.       echo "or is not executable."
  199.       echo "Please consult a system administrator for the correct path"
  200.       echo "to the Netscape browser installation directory."
  201.       echo " "
  202.     fi
  203.   fi
  204. else
  205.   echo " "
  206.   echo "$ndir either does not exist, or is not a directory."
  207.   echo "Please consult a system administrator for the corret path"
  208.   echo "to the Netscape browser installation directory."
  209.   echo " "
  210. fi
  211.  
  212. exit 1
  213.  
  214.